export const metadata = { sidebar_position: 7, title: "🟡 最少到最多提示过程" };

# 🟡 最少到最多提示过程

最少到最多提示过程 (Least to Most prompting, LtM)(@zhou2022leasttomost) 将 %%思维链提示过程 (CoT prompting)|CoT prompting%% 进一步发展，首先将问题分解为子问题，然后逐个解决。它是受到针对儿童的现实教育策略的启发而发展出的一种技术。

与思维链提示过程类似，需要解决的问题被分解成一组建立在彼此之上的子问题。在第二步中，这些子问题被逐个解决。与思维链不同的是，先前子问题的解决方案被输入到提示中，以尝试解决下一个问题。

<div style={{ textAlign: "center" }}>
  <Image
    src="/docs/assets/intermediate/least_to_most_formal.webp"
    width={1080}
    height={752}
    style={{ width: "600px", margin: "auto" }}
  />
</div>

<div style={{ textAlign: "center" }}>LtM 的图示</div>

## 示例：回复客户咨询

让我们问一个稍微复杂的客服问题：

<iframe
  src="https://embed.learnprompting.org/embed?config=eyJ0b3BQIjowLCJ0ZW1wZXJhdHVyZSI6MCwibWF4VG9rZW5zIjoyNTYsIm91dHB1dCI6IuWwiuaVrOeahOWuouaIt%2B%2B8jFxcbuaEn%2BiwouaCqOi0reS5sOaIkeS7rOeahCBBcm5vbGQg57O75YiXVOaBpOOAguaIkeS7rOW%2BiOmrmOWFtOiDveS4uuaCqOaPkOS%2Bm%2BacjeWKoeOAglxcblxcbuW%2BiOmBl%2BaGvu%2B8jOaIkeS7rOS4jeiDveaOpeWPl%2BaCqOeahOmAgOi0p%2B%2B8jOWboOS4uuaCqOW3sue7j%2Bi2hei%2Fh%2BS6huaIkeS7rOeahDMw5aSp6YCA6LSn5pS%2F562W44CC5L2G5piv77yM5oiR5Lus546w5Zyo5q2j5Zyo5Li%2B6KGM5LiA5Liq54m55Yir55qEVOaBpOaKmOaJo%2Ba0u%2BWKqO%2B8jOaJgOaciVTmgaTpg73mnIk1MO%2B8heeahOaKmOaJo%2BOAguaCqOWPr%2BS7peS9v%2BeUqOaCqOeahOW6l%2BWGheenr%2BWIhuadpei0reS5sOS4pOS7tlTmgaQiLCJwcm9tcHQiOiLlrqLmiLflkqjor6I6XFxu5oiR5ZyoM%2BaciDHml6XotK3kubDkuobkvaDku6wgQXJub2xkIOezu%2BWIl%2BeahOS4gOS7tlTmgaTjgILmiJHnnIvliLDlroPmnInmipjmiaPvvIzmiYDku6XkubDkuobkuIDku7bljp%2Fku7fkuLogMzAg576O5YWD55qE6KGs6KGr77yM5omT5LqGIDYg5oqY44CC5oiR5Y%2BR546w5L2g5Lus546w5Zyo5pyJ5LiA5Liq5paw55qEVOaBpOaKmOaJo%2Ba0u%2BWKqO%2B8jDUwJSBvZmbjgILmiJHmg7Pnn6XpgZPmiJHmmK%2FlkKblj6%2Fku6XpgIDotKfvvIzlkIzml7bmi6XmnInotrPlpJ%2FnmoTlupflhoXnp6%2FliIbmnaXotK3kubDkuKTku7bkvaDku6znmoRU5oGk77yfXFxuXFxu5oyH5LukOlxcbuS9oOaYr%2BS4gOWQjeWuouaIt%2BacjeWKoeS7o%2BihqO%2B8jOi0n%2Bi0o%2BWPi%2BWlveWcsOWbnuWkjeWuouaIt%2BeahOafpeivouOAgumAgOi0p%2BWcqCAzMCDlpKnlhoXlhYHorrjjgILku4rlpKnmmK8gMyDmnIggMjkg5pel44CC55uu5YmN5omA5pyJ6KGs6KGr6YO95pyJIDUwJSDnmoTmipjmiaPjgILkvaDnmoTlupfph4zooazooavku7fmoLzlnKggMTgtMTAwIOe%2BjuWFg%2BS5i%2BmXtOOAguivt%2BWLv%2Be8lumAoOS7u%2BS9leWFs%2BS6juaKmOaJo%2BaUv%2BetlueahOS%2FoeaBr%2BOAgiIsIm1vZGVsIjoidGV4dC1kYXZpbmNpLTAwMyJ9"
  style={{
    width: "100%",
    height: "500px",
    border: "0",
    borderRadius: "4px",
    overflow: "hidden",
  }}
  sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
></iframe>

<br />
这个回答是错误的（目前还在退货时间内），那我们来将问题分解为子问题试试：

<iframe
  src="https://embed.learnprompting.org/embed?config=eyJtb2Rlb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Lu35qC86IyD5Zu077ybXG40LuWuouaIt%2BaYr%2BWQpuaciei2s%2BWkn%2BeahOW6l%2BWGheenr%2BWIhu%2B8m1xuNS7lrqLmiLfpgIDotKfnmoTmlL%2FnrZbjgIIiLCJtYXhUb2tlbnMiOjI1NiwiYm94Um93cyI6MTIsInRlbXBlcmF0dXJlIjowLCJ0b3BQIjowfQ%3D%3D"
  style={{
    width: "100%",
    height: "600px",
    border: "0",
    borderRadius: "4px",
    overflow: "hidden",
  }}
  sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
></iframe>

<br />
让我们试着解决第一个子问题：

<iframe
  src="https://embed.learnprompting.org/embed?config=eyJtb2RlbCI6InRleHQtZGF2aW5jaS0wMDMiLCJwcm9tcHQiOiLlrqLmiLflkqjor6I6XG7miJHlnKgz5pyIMeaXpei0reS5sOS6huS9oOS7rCBBcm5vbGQg57O75YiX55qE5LiA5Lu2VOaBpOOAguaIkeeci%2BWIsOWug%2BacieaKmOaJo%2B%2B8jOaJgOS7peS5sOS6huS4gOS7tuWOn%2BS7t%2BS4uiAzMCDnvo7lhYPnmoTooazooavvvIzmiZPkuoYgNiDmipjjgILmiJHlj5HnjrDkvaDku6znjrDlnKjmnInkuIDkuKrmlrDnmoRU5oGk5oqY5omj5rS75Yqo77yMNTAlIG9mZuOAguaIkeaDs%2BefpemBk%2BaIkeaYr%2BWQpuWPr%2BS7pemAgOi0p%2B%2B8jOWQjOaXtuaLpeaciei2s%2BWkn%2BeahOW6l%2BWGheenr%2BWIhuadpei0reS5sOS4pOS7tuS9oOS7rOeahFTmgaTvvJ9cblxu5oyH5LukOlxu5L2g5piv5LiA5ZCN5a6i5oi35pyN5Yqh5Luj6KGo77yM6LSf6LSj5Y%2BL5aW95Zyw5Zue5aSN5a6i5oi355qE5p%2Bl6K%2Bi44CC6YCA6LSn5ZyoIDMwIOWkqeWGheWFgeiuuOOAguS7iuWkqeaYryAzIOaciCAyOSDml6XjgILnm67liY3miYDmnInooazoo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5Lus6IGU57O744CC5oiR5Lus5bCG56ut6K%2Ba5Li65oKo5pyN5Yqh77yBIiwibWF4VG9rZW5zIjo1MTIsImJveFJvd3MiOjE5LCJ0ZW1wZXJhdHVyZSI6MCwidG9wUCI6MH0%3D"
  style={{
    width: "100%",
    height: "950px",
    border: "0",
    borderRadius: "4px",
    overflow: "hidden",
  }}
  sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
></iframe>

仅仅通过解决第一个子问题，我们就能解决整个问题。如果 GPT-3 没有立即给出答案，我们可以解决下一个子问题，直到它返回答案。值得注意的是，我们使用 `让我们一步一步来` 的提示短语。这个提示不是必须的，但对于这个例子来说效果很好。

## 示例：字符连接

LtM 最初是使用 few-shot 提示的方式引入的，而不是显式指令将问题分解为多个步骤（如上所示）。除此之外，有时也可以使用单一提示而不是提示链来实现它。让我们来看看字符连接的尾字问题(@wei2022chain)，例如给定输入词语 `思考、机器`，则输出应为 `考器`。

### 第一次尝试：标准提示

即使使用更先进的模型（如 text-davinci-003），标准提示与 few-shot 示例的表现也非常糟糕。

<iframe
  src="https://embed.learnprompting.org/embed?config=eyJib3hSb3dzIjoxOCwidG9wUCI6MSwidGVtcGVyYXR1cmUiOjAuMiwibWF4VG9rZW5zIjoyNTYsIm91dHB1dCI6IuS4ieWbm%2BaJi%2BmSsSIsInByb21wdCI6IlE6IOaAneiAg%2BOAgeacuuWZqFxuQTog6ICD5ZmoXG5cblE6IOWtpuS5oOOAgeaOqOeQhuOAgeW9kue6s1xuQTog5Lmg55CG57qzXG5cblE6IOS6uuW3peOAgeaZuuiDvVxuQTog5bel6IO9XG5cblE6IOi9rOWMluWZqOOAgeivreiogOOAgeinhuiniVxuQTog5Zmo6KiA6KeJXG5cblE6IOW8oOS4ieOAgeadjuWbm%2BOAgeaJi%2BacuuOAgemSseWMhVxuQToiLCJtb2RlbCI6InRleHQtZGF2aW5jaS0wMDMifQ%3D%3D"
  style={{
    width: "100%",
    height: "900px",
    border: "0",
    borderRadius: "4px",
    overflow: "hidden",
  }}
  sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
></iframe>

### 第二次尝试：思维链

思维链的表现比标准提示好得多。这是因为它现在允许模型考虑自己提取每个单词的最后一个字母，将复杂性降低到分组已经收集的字母的行为。然而，这种方法在更长的输入下也可能慢慢出现问题。

<iframe
  src="https://embed.learnprompting.org/embed?config=eyJib3hSb3dzIjoxOCwidG9wUCI6MSwidGVtcGVyYXR1cmUiOjAuMiwibWF4VG9rZW5zIjoyNTYsIm91dHB1dCI6IiflvKDkuIkn55qE5bC%2B5a2X5pivJ%2BS4iSfvvIwn5p2O5ZubJ%2BeahOWwvuWtl%2BaYryflm5sn77yMJ%2BaJi%2BacuifnmoTlsL7lrZfmmK8n5py6J%2B%2B8jCfpkrHljIUn55qE5bC%2B5a2X5pivJ%2BWMhSfvvIzmiYDku6XnrZTmoYjmmK8n5LiJ5Zub5py65YyFJyIsInByb21wdCI6IlE6IOaAneiAg%2BOAgeacuuWZqFxuQTogJ%2BaAneiAgyfnmoTlsL7lrZfmmK8n6ICDJ%2B%2B8jCfmnLrlmagn55qE5bC%2B5a2X5pivJ%2BWZqCfvvIzmiYDku6XnrZTmoYjmmK8n6ICD5ZmoJ1xuXG5ROiDlrabkuaDjgIHmjqjnkIbjgIHlvZLnurNcbkE6ICflrabkuaAn55qE5bC%2B5a2X5pivJ%2BS5oCfvvIwn5o6o55CGJ%2BeahOWwvuWtl%2BaYryfnkIYn77yMJ%2BW9kue6syfnmoTlsL7lrZfmmK8n57qzJ%2B%2B8jOaJgOS7peetlOahiOaYryfkuaDnkIbnurMnXG5cblE6IOi9rOWMluWZqOOAgeivreiogOOAgeinhuiniVxuQTogJ%2Bi9rOWMluWZqCfnmoTlsL7lrZfmmK8n5ZmoJ%2B%2B8jCfor63oqIAn55qE5bC%2B5a2X5pivJ%2BiogCfvvIwn6KeG6KeJJ%2BeahOWwvuWtl%2BaYryfop4kn77yM5omA5Lul562U5qGI5pivJ%2BWZqOiogOiniSdcblxuUTog5byg5LiJ44CB5p2O5Zub44CB5omL5py644CB6ZKx5YyFXG5BOiAiLCJtb2RlbCI6InRleHQtZGF2aW5jaS0wMDMifQ%3D%3D"
  style={{
    width: "100%",
    height: "900px",
    border: "0",
    borderRadius: "4px",
    overflow: "hidden",
  }}
  sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
></iframe>

### 第三次尝试：LtM（单一提示）

使用 LtM，我们通过重新表述先前串联的结果来增强思维链的概念。这种做法使得每个步骤变的简单，即每次只需要连接一个字符。这种方法带来了非常好的效果，12 个乃至更多的词都能得到正确结果。

这种方法看起来与思维链非常相似，但在概念上大有不同。在这里，每一步都引入了上一步连接的结果。例如，在“思考、机器、学习”的这个例子种，它不会单独连接字符“考”，“器”，“习”，而是连接“考”和“器”，然后连接“考器”和“习”。由于重新引入了上一步的结果，模型现在可以推广到更长的链，因为它每一步都带着增量结果，同时单步骤内只需要做很少的工作。

<iframe
  src="https://embed.learnprompting.org/embed?config=eyJib3hSb3dzIjoxOCwidG9wUCI6MSwidGVtcGVyYXR1cmUiOjAuMiwibWF4VG9rZW5zIjoxMDI0LCJvdXRwdXQiOiIn5byg5LiJfOadjuWbmyfnmoTovpPlh7rnu5PmnpzmmK8n5LiJ5ZubJ%2B%2B8jCfmiYvmnLp86ZKx5YyFJ%2BeahOi%2Bk%2BWHuue7k%2BaenOaYryfmnLrljIUn77yMJ%2BmSpeWMmXzmiL%2FlrZAn55qE6L6T5Ye657uT5p6c5pivJ%2BWMmeWtkCfvvIwn5rG96L2mfOeUteiEkSfnmoTovpPlh7rnu5PmnpzmmK8n6L2m6ISRJ%2B%2B8jCfkuaZ855S16KeGJ%2BeahOi%2Bk%2BWHuue7k%2BaenOaYryfkuabop4Yn77yMJ%2BWPr%2BS5kHzpm6rnoqcn55qE6L6T5Ye657uT5p6c5pivJ%2BS5kOeipyfvvIwn5qmY54yrJ%2BeahOi%2Bk%2BWHuue7k%2BaenOaYry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KiAJ%2BeahOacgOWQjuS4gOS4quWtl%2BavjeaYryfoqIAn44CC5bCGJ%2BWZqCflkown6KiAJ%2BS4suiBlOi1t%2BadpeWwseW%2Bl%2BWIsCflmajoqIAn44CC5omA5LulJ%2Bi9rOWMluWZqHzor63oqIAn55qE6L6T5Ye657uT5p6c5pivJ%2BWZqOiogCfjgIJcblxuUTog6L2s5YyW5ZmofOivreiogHzop4bop4lcbkE6ICfovazljJblmah86K%2Bt6KiAJ%2BeahOi%2Bk%2BWHuue7k%2BaenOaYryflmajoqIAn77yMJ%2BinhuiniSfnmoTmnIDlkI7kuIDkuKrlrZfmr43mmK8n6KeJJ%2BOAguWwhiflmajoqIAn5ZKMJ%2BiniSfkuLLogZTotbfmnaXlsLHlvpfliLAn5Zmo6KiA6KeJJ%2BOAguaJgOS7pSfovazljJblmah86K%2Bt6KiAfOinhuiniSfnmoTovpPlh7rnu5PmnpzmmK8n5Zmo6KiA6KeJJ%2BOAglxuXG5ROiDlvKDkuIl85p2O5ZubfOaJi%2BacunzpkrHljIV86ZKl5YyZfOaIv%2BWtkHzmsb3ovaZ855S16ISRfOS5pnznlLXop4Z85Y%2Bv5LmQfOmbqueip3zmqZjnjKtcbkE6ICIsIm1vZGVsIjoidGV4dC1kYXZpbmNpLTAwMyJ9"
  style={{
    width: "100%",
    height: "900px",
    border: "0",
    borderRadius: "4px",
    overflow: "hidden",
  }}
  sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
></iframe>
（译注：该例子使用了 '|' 而非 '，'，是因为中文的逗号经常不被识别为分隔符）。

### 结论

在具有 12 个词的字符问题上，思维链的准确率为 34％，而 LtM 的准确率为 74％（该论文使用 text-davinci-002 作为模型）（译注：上面的示例因为翻译成了中文，所以准确率与原文中的值应该不同）。

## 示例：组合泛化问题(compositional generalization) (SCAN)

SCAN 基准测试(@lake2018scan)要求模型将自然语言转换为动作序列。例如，句子 “run left and walk twice” 将被翻译为 “TURN_LEFT + RUN + WALK \* 2”。当面对训练集中长度更长的序列时，语言模型的表现尤其差。

### 第一次尝试：标准提示

使用简单的标准提示，text-davinci-003 的表现非常出色，但仍然失败了。

<iframe
  src="https://embed.learnprompting.org/embed?config=eyJib3hSb3dzIjoxOCwidG9wUCI6MSwidGVtcGVyYXR1cmUiOjAuMiwibWF4VG9rZW5zIjo1MTIsIm91dHB1dCI6IihUVVJOIExFRlQgKiAyICsgV0FMSykgKiAzICsgKFRVUk4gTEVGVCArIEpVTVApICogMiIsInByb21wdCI6IlE6IHR1cm4gbGVmdFxuQTogVFVSTiBMRUZUXG5cblE6IHR1cm4gcmlnaHRcbkE6IFRVUk4gUklHSFRcblxuUToganVtcCBsZWZ0XG5BOiBUVVJOIExFRlQgKyBKVU1QXG5cblE6IHJ1biByaWdodFxuQTogVFVSTiBSSUdIVCArIFJVTlxuXG5ROiBsb29rIHR3aWNlXG5BOiBMT09LICogMlxuXG5ROiBydW4gYW5kIGxvb2sgdHdpY2VcbkE6IFJVTiArIExPT0sgKiAyXG5cblE6IGp1bXAgcmlnaHQgdGhyaWNlXG5BOiAoVFVSTiBSSUdIVCArIEpVTVApICogM1xuXG5ROiB3YWxrIGFmdGVyIHJ1blxuQTogUlVOICsgV0FMS1xuXG5ROiB0dXJuIG9wcG9zaXRlIGxlZnRcbkE6IFRVUk4gTEVGVCAqIDJcblxuUTogdHVybiBhcm91bmQgbGVmdFxuQTogVFVSTiBMRUZUICogNFxuXG5ROiB0dXJuIG9wcG9zaXRlIHJpZ2h0XG5BOiBUVVJOIFJJR0hUICogMlxuXG5ROiB0dXJuIGFyb3VuZCByaWdodFxuQTogVFVSTiBSSUdIVCAqIDRcblxuUTogd2FsayBvcHBvc2l0ZSBsZWZ0XG5BOiBUVVJOIExFRlQgKiAyICsgV0FMS1xuXG5ROiB3YWxrIGFyb3VuZCBsZWZ0XG5BOiAoVFVSTiBMRUZUICsgV0FMSykgKiA0XG5cblE6IFwianVtcCBhcm91bmQgbGVmdCB0d2ljZSBhZnRlciB3YWxrIG9wcG9zaXRlIGxlZnQgdGhyaWNlXCIgXG5BOiIsIm1vZGVsIjoidGV4dC1kYXZpbmNpLTAwMyJ9"
  style={{
    width: "100%",
    height: "900px",
    border: "0",
    borderRadius: "4px",
    overflow: "hidden",
  }}
  sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
></iframe>

（译注：该示例如果翻译成中文，无法复现效果，因此保持原文）

### 第二次尝试：LtM，第一步 - 缩减

在这里，我们使用两个不同的提示。第一个提示用于将输入问题缩减为一个步骤序列。第二个提示用于将这个缩减后的步骤序列映射到实际的操作中。

这两个提示都相当长，因而使用压缩的 Python 符号表示操作，以节省标记（tokens）。

第一步将自然语言描述分解为更明确但仍类似人类的语言。这将有助于映射步骤按顺序解决问题。
例如，“jump around left twice” 被简化为 “jump left” -> TURN_LEFT + JUMP 和 “jump around left” -> (TURN_LEFT + JUMP) \* 4。同样，减少步骤是用来解释重复概念（twice、thrice 等）的。

<iframe
  src="https://embed.learnprompting.org/embed?config=eyJib3hSb3dzIjoxOCwidG9wUCI6MSwidGVtcGVyYXR1cmUiOjAuMiwibWF4VG9rZW5zIjoyNTYsIm91dHB1dCI6IlwianVtcCBhcm91bmQgbGVmdCB0d2ljZVwiIGNhbiBiZSBzb2x2ZWQgYnk6IFwianVtcCBsZWZ0XCIsIFwianVtcCBhcm91bmQgbGVmdFwiLCBcImp1bXAgYXJvdW5kIGxlZnQgdHdpY2VcIi4gXCJ3YWxrIG9wcG9zaXRlIGxlZnQgdGhyaWNlXCIgY2FuIGJlIHNvbHZlZCBieTogXCJ3YWxrIG9wcG9zaXRlIGxlZnRcIiwgXCJ3YWxrIG9wcG9zaXRlIGxlZnQgdGhyaWNlXCIuIFNvLCBcImp1bXAgYXJvdW5kIGxlZnQgdHdpY2UgYWZ0ZXIgd2FsayBvcHBvc2l0ZSBsZWZ0IHRocmljZVwiIGNhbiBiZSBzb2x2ZWQgYnk6IFwianVtcCBsZWZ0XCIsIFwianVtcCBhcm91bmQ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FNvLCBcImxvb2sgYXJvdW5kIHJpZ2h0IHRocmljZSBhbmQgd2Fsa1wiIGNhbiBiZSBzb2x2ZWQgYnk6IFwibG9vayByaWdodFwiLCBcImxvb2sgYXJvdW5kIHJpZ2h0XCIsIFwibG9vayBhcm91bmQgcmlnaHQgdGhyaWNlXCIsIFwid2Fsa1wiLlxuXG5ROiB0dXJuIHJpZ2h0IGFmdGVyIHJ1biByaWdodCB0aHJpY2VcbkE6IFwidHVybiByaWdodFwiIGNhbiBiZSBzb2x2ZWQgYnk6IFwidHVybiByaWdodFwiLiBcInJ1biByaWdodCB0aHJpY2VcIiBjYW4gYmUgc29sdmVkIGJ5OiBcInJ1biByaWdodFwiLCBcInJ1biByaWdodCB0aHJpY2VcIi4gU28sIFwidHVybiByaWdodCBhZnRlciBydW4gcmlnaHQgdGhyaWNlXCIgY2FuIGJlIHNvbHZlZCBieTogXCJ0dXJuIHJpZ2h0XCIsIFwicnVuIHJpZ2h0XCIsIFwicnVuIHJpZ2h0IHRocmljZVwiLlxuXG5ROiBqdW1wIGFyb3VuZCBsZWZ0IHR3aWNlIGFmdGVyIHdhbGsgb3Bwb3NpdGUgbGVmdCB0aHJpY2VcbkE6IiwibW9kZWwiOiJ0ZXh0LWRhdmluY2ktMDAzIn0%3D"
  style={{
    width: "100%",
    height: "900px",
    border: "0",
    borderRadius: "4px",
    overflow: "hidden",
  }}
  sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
></iframe>

### 第二次尝试：LtM，第二步 - 映射

在第二步中，我们使用缩减过的结果，并再次使用相当长的提示（14个案例）将简化的自然语言描述转换为一系列操作。

在这里，我们注入第一步的输出：

> "jump around left twice" can be solved by: "jump left", "jump around left", "jump around left twice". "walk opposite left thrice" can be solved by: "walk opposite left", "walk opposite left thrice". So, "jump around left twice after walk opposite left thrice" can be solved by: "jump left", "jump around left", "jump around left twice", "walk opposite left", "walk opposite left thrice".

到 LLM 中。

<iframe
  src="https://embed.learnprompting.org/embed?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B1dCBvZiBcIndhbGsgbGVmdFwiLCB0aGUgb3V0cHV0IG9mIFwid2FsayBsZWZ0XCIsIHRoZSBvdXRwdXQgb2YgXCJ3YWxrIGxlZnRcIi4gXCJ3YWxrIGxlZnRcIiBvdXRwdXRzIFwiVFVSTiBMRUZUXCIgKyBcIldBTEtcIi4gU28gcmVwZWF0aW5nIHRoZSBvdXRwdXQgb2YgXCJ3YWxrIGFyb3VuZCBsZWZ0XCIgZm91ciB0aW1lcyBsZWFkcyB0byAoXCJUVVJOIExFRlRcIiArIFwiV0FMS1wiKSAqIDQuIFNvIHRoZSBvdXRwdXQgb2YgXCJ3YWxrIGFyb3VuZCBsZWZ0XCIgaXMgKFwiVFVSTiBMRUZUXCIgKyBcIldBTEtcIikgKiA0LlxuXG5ROiBcImp1bXAgYXJvdW5kIGxlZnQgdHdpY2UgYWZ0ZXIgd2FsayBvcHBvc2l0ZSBsZWZ0IHRocmljZVwiIFxuQToiLCJtb2RlbCI6InRleHQtZGF2aW5jaS0wMDMifQ%3D%3D"
  style={{
    width: "100%",
    height: "900px",
    border: "0",
    borderRadius: "4px",
    overflow: "hidden",
  }}
  sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
></iframe>

### 结论

LtM 带来了多项提升：

- 相对于思维链提高了准确性
- 在难度高于提示的问题上提升了泛化能力
- 在组合泛化方面的性能得到了显著提高，特别是在SCAN基准测试(@lake2018scan)中

使用 text-davinci-002（论文中使用的模型）的标准提示解决了 6% 的 SCAN 问题，而 LtM 提示则取得了惊人的 76% 的成功率。在 code-davinci-002 中，结果更为显著，LtM 达到了 99.7% 的成功率。
